import "./index.css";
import React, { useContext } from "react";
import TestContext from "../../utils";

function MyTestOne() {
  const { testNum, setTestNum } = useContext(TestContext);

  const handleButton = () => {
    setTestNum(testNum + 2);
  };
  return (
    <>
      <div>这是我都测试context上下文的组件1~~~~~{testNum}@@@@@@@</div>
      <button onClick={handleButton}>点击我改变上下文</button>
    </>
  );
}

export default MyTestOne;
